/**
 * 
 */
package caiziyou.com.override;

public class OverrideTest {

	public static void main(String[] args) {
		Base sub = new Sub();
		sub.add(1, 2);
		Base sub1 = new Sub1();
		sub1.add(1, 2, 3);

		Sub1 subR = (Sub1) sub1;
		subR.add(1, 2, 3);
	}
}

class Base {
	public void add(int a, int... arr) {
		System.out.println("base");
	}
}

class Sub extends Base {
	public void add(int a, int[] arr) {
		System.out.println("sub");
	}

}

class Sub1 extends Base {
	public void add(int a, int b, int c) {
		System.out.println("sub1");
	}
}